﻿using SmartPlant.Model;
using SmartPlant.Model.DbContext.Biz;
using SmartPlant.Services.Interfaces;
using SqlSugar;
using System.Collections.Generic;
using System.IO;
using System.Threading.Tasks;

namespace SmartPlant.Services
{
    /// <summary>
    /// 对应SpecDataTemplate控制器
    /// </summary>
    public class SpecDataTemplateService : BaseService, ISpecDataTemplateService
    {
        /// <summary>
        /// 查询SpecDataTemplate表里的记录
        /// </summary>
        /// <param name="proId"></param>
        /// <returns></returns>
        public async Task<List<SpecDataTemplate>> GetListAsync(string proId, string SpecReportId)
        {
            string uri = $"/api/Project/{proId}/Spec-Data-Template-Api/{SpecReportId}";
            var res = await GetAsync<List<SpecDataTemplate>>(uri);
            return res.data;
        }

        /// <summary>
        /// 查询SpecDataTemplate表里的记录（所有的）
        /// </summary>
        /// <param name="proId"></param>
        /// <returns></returns>
        public async Task<List<SpecDataTemplate>> GetLisAsync(string proId, string SpecReportId, string SpecDataTemplateName)
        {
            string uri = $"/api/Project/{proId}/Spec-Data-Template-Api/{SpecReportId}/{SpecDataTemplateName}";
            var res = await GetAsync<List<SpecDataTemplate>>(uri);
            return res.data;
        }

        
    }
}
